package com.lnyt.util.factroy;

import org.springframework.stereotype.Component;

import com.lnyt.pojo.weixin.ReqAllMessage;
import com.lnyt.pojo.weixin.ResTextMessage;


@Component
public class WeixinResFactroy {
    // 文本信息工厂
    public static ResTextMessage creatorText(ReqAllMessage reqAllMessage, String text) {
        ResTextMessage textMessage = new ResTextMessage();

        textMessage.setToUserName(reqAllMessage.getFromUserName());
        textMessage.setFromUserName(reqAllMessage.getToUserName());
        textMessage.setMsgType("text");
        textMessage.setCreateTime(System.currentTimeMillis() / 1000);
        textMessage.setContent(text);

        return textMessage;
    }

}
